// 拖拽小组件 / 复制
export const cloneWidget = (params) => {
  const key = Math.random().toString(36).substring(2, 9);
  params = JSON.parse(
    JSON.stringify({
      ...params,
      key,
      model: `${params.type}_${key}`
    })
  );
  return params;
};

// 筛选出key,用于判断表单属性填写区域组件的显示与隐藏
export const hasKey = (data, key) => {
  return Object.keys(data.options).includes(key);
};
